const {ccclass, property} = cc._decorator;
export let GameViews:GameView;
@ccclass
export default class GameView extends cc.Component {
    @property(cc.Node)
    viewContent:cc.Node = null;
    @property(cc.Prefab)
    pfSelecFish:cc.Prefab = null;

    onLoad(){
        GameViews = this;
    }

    _viewData = {};
    showView(type, data){
        let nodeView = null;
        if(!this._viewData[type]){
            nodeView = cc.instantiate(this[type]);
        }
        else
        {
            nodeView = this._viewData[type];
        }

        let nodeItem = nodeView.getComponent(nodeView.name);
        this.viewContent.addChild(nodeView);
        nodeItem.setViewData(data);
    }
}
